<template>
    <div class="flh_datakb">
          <div id="morphing-content" class="hidden">
            <iframe id="myIframe" width="1400px" height="800px"></iframe>
          </div>
          <!-- <div id="morphing-content1" class="hidden">
            <iframe src="http://172.16.0.135:9024/index.html#/pages/bigDataflh/customerData" width="1400px" height="800px"></iframe>
          </div>
          <div id="morphing-content2" class="hidden">
            <iframe src="http://172.16.0.135:9024/index.html#/pages/bigDataflh/newsTrading" width="1400px" height="800px"></iframe>
          </div>
          <div id="morphing-content3" class="hidden">
            <iframe src="http://172.16.0.135:9024/index.html#/pages/bigDataflh/staffData" width="1400px" height="800px"></iframe>
          </div>
          <div id="morphing-content4" class="hidden">
            <iframe src="http://172.16.0.135:9024/index.html#/pages/bigDataflh/newsWorkload" width="1400px" height="800px"></iframe>
          </div> -->
      <div class="mainView">
        <div class="pandect">
          <h2 class="title">房联行数据看板</h2>
          <div class="gear">
            <div class="gear_volume">
              <p>当月成交量(套)</p>
              <p>
                <i-count-up :startVal="startVal" :endVal="pageData.thisMonthDealNum" :decimals="decimals" :duration="duration" :options="options" />
              </p>
            </div>
            <div class="gear_amount">
              <p>当月佣金额(万元)</p>
              <p>
                <i-count-up :startVal="startVal" :endVal="pageData.thisMonthAchievement" :decimals="decimals" :duration="duration" :options="options" />
              </p>
            </div>
          </div>
        </div>
        <div  class="myMask">
          <div class="position" >
            <iframe src="#/pages/bigDataflh/housingData" frameborder="0"></iframe>
          </div>
          <div class="test" data-morphing data-src="#morphing-content"></div>
        </div>
        <div class="myMask">
          <div class="position">
            <iframe src="#/pages/bigDataflh/customerData" frameborder="0"></iframe>
          </div>
          <div class="test" data-morphing1  data-src="#morphing-content"></div>
        </div>
        <div class="myMask">
          <div class="position">
            <iframe src="#/pages/bigDataflh/newsTrading" frameborder="0"></iframe>
            <!-- <div id="test" @click="clickFun('#/pages/bigDataflh/newsTrading')"></div> -->
          </div>
          <div class="test" data-morphing2  data-src="#morphing-content"></div>
        </div>
        <div class="myMask">
          <div class="position">
            <iframe src="#/pages/bigDataflh/staffData" frameborder="0"></iframe>
            <!-- <div id="test" @click="clickFun('#/pages/bigDataflh/staffData')"></div> -->
          </div>
          <div class="test" data-morphing3  data-src="#morphing-content"></div>
        </div>
        <div class="myMask">
          <div class="position">
            <iframe src="#/pages/bigDataflh/heatMap" frameborder="0"></iframe>
          </div>
          <div class="test" data-morphing6  data-src="#morphing-content"></div>
        </div>
        <div class="myMask">
          <div class="position">
            <iframe src="#/pages/bigDataflh/newsWorkload" frameborder="0"></iframe>
            <!-- <div id="test" @click="clickFun('#/pages/bigDataflh/newsWorkload')"></div> -->
          </div>
          <div class="test" data-morphing4  data-src="#morphing-content"></div>
        </div>
        <div class="myMask">
          <div class="position">
            <iframe src="https://beyond.3dnest.cn/house/?m=zq_mqy_1&from=singlemessage&isappinstalled=0" frameborder="0"></iframe>
            <!-- <div id="test" @click="clickFun('#/pages/bigDataflh/newsWorkload')"></div> -->
          </div>
          <div class="test" data-morphing5  data-src="#morphing-content"></div>
        </div>
      </div>
    </div>
</template>

<script>
import ICountUp from "vue-countup-v2";
import fancybox from "@fancyapps/fancybox";
import myJs from "./components/myJs.js";
import {
  GetSumDataByCity // 获取页面总数据
} from "@/api/flh/home";
export default {
  components: {
    ICountUp
  },
  data() {
    return {
      startVal: 0,
      decimals: 0,
      duration: 2.5,
      options: {
        useEasing: true,
        useGrouping: true,
        separator: ",",
        decimal: ".",
        prefix: "",
        suffix: ""
      },
      gear_volume: 9566,
      gear_amount: 349340,
      pageData: {
        name: "洛阳",
        storeNum: 0,
        dealNum: 0,
        thisMonthDealNum: 0,
        totalAchievement: 0,
        thisMonthAchievement: 0
      }
    };
  },
  mounted() {
    myJs();
    this.fetchData();
  },
  methods: {
    fetchData() {
      this.fetchGetSumDataByCity();
    },
    // 页面总数据
    async fetchGetSumDataByCity() {
      var params = {
        cityId: 36001
      };
      try {
        var res = await GetSumDataByCity(params);
        if (res.data.code === "0") {
          this.$set(this, "pageData", res.data.result[0]);
        }
      } catch (e) {
        console.log(e);
      }
    },
    clickFun(path) {
      $.fancybox.open({
        src: path,
        type: "iframe",
        opts: {
          afterShow: function(instance, current) {
            console.info("done!");
          }
        }
      });
    }
  }
};
</script>
<style>
@import "../../../../../../static/css/jquery.fancybox.css";
.morphing-btn-wrap {
  display: inline-block;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  text-align: center;
}

.morphing-btn {
  -webkit-transition: background 0.3s, color 0.2s 0.2s, width 0.2s 0s;
  -moz-transition: background 0.3s, color 0.2s 0.2s, width 0.2s 0s;
  -o-transition: background 0.3s, color 0.2s 0.2s, width 0.2s 0s;
  transition: color 0.3s 0.2s, width 0.2s 0s;
  white-space: nowrap;
  box-sizing: border-box;
}

.morphing-btn_circle {
  color: transparent !important;
  padding-left: 0;
  padding-right: 0;
  width: 35.6px !important;
  height: 35.6px !important;
  /* Override inline style rule */
  -webkit-transition: color 0.2s 0s, width 0.3s 0.2s;
  -moz-transition: color 0.2s 0s, width 0.3s 0.2s;
  -o-transition: color 0.2s 0s, width 0.3s 0.2s;
  transition: color 0.2s 0s, width 0.3s 0.2s;
}

.morphing-btn-clone {
  position: fixed;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  z-index: 99999;
  -webkit-transition: all 1.5s cubic-bezier(0.65, 0.05, 0.36, 1);
  -moz-transition: all 1.5s cubic-bezier(0.65, 0.05, 0.36, 1);
  -o-transition: all 1.5s cubic-bezier(0.65, 0.05, 0.36, 1);
  transition: all 1.5s cubic-bezier(0.65, 0.05, 0.36, 1);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.hidden {
  display: none;
}
.morphing-btn-clone_visible {
  display: block;
  -webkit-transform: scale(1) !important;
  -moz-transform: scale(1) !important;
  -ms-transform: scale(1) !important;
  -o-transform: scale(1) !important;
  transform: scale(1) !important;
}

.fancybox-morphing .fancybox-bg {
  background: rgba(0, 0, 0, 0.8);
  opacity: 1;
}

.fancybox-morphing .fancybox-toolbar {
  top: 20px;
  right: 40px;
}

.fancybox-morphing .fancybox-button--close {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  color: #fff;
}

.fancybox-morphing .fancybox-button--close::after,
.fancybox-morphing .fancybox-button--close::before {
  height: 1.55px;
  width: 22px;
  left: calc(50% - 11px);
}

.fancybox-morphing .fancybox-button--close:hover {
  background: rgba(0, 0, 0, 0.4);
}

/* Styling for element used in example */

#morphing-content,
#morphing-content1,
#morphing-content2,
#morphing-content3,
#morphing-content4 {
  margin: 0;
  position: relative;
  background: transparent;
  color: #fff;
  padding: 6em 10vw;
  line-height: 2;
  z-index: 3;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
</style>

<style lang="scss" scoped>
@import "../../../../../styles/base/_parameters";

.flh_datakb {
  @include absoluteAllSides;
  overflow: hidden;
  .mainView {
    @include absoluteAllSides(40, 40, 40, 40, 1);
    .myMask {
      .position {
        width: 100%;
        height: 100%;
        position: relative;
      }
      width: 600px;
      height: 320px;
      background: url("../../../../../../static/img/flh/news/iframe_bg.png")
        left top no-repeat;
      background-size: 100% 100%;
      iframe {
        width: calc(100% - 6px);
        height: calc(100% - 6px);
        transform: translate(3px, 3px);
      }
      .test {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 9999;
        cursor: pointer;
      }
      // #morphing {
      //   content: "";
      //   position: absolute;
      //   top: 0;
      //   right: 0;
      //   bottom: 0;
      //   left: 0;
      //   z-index: 9999;
      //   cursor: pointer;
      // }
      &:nth-of-type(2) {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1;
      }
      &:nth-of-type(3) {
        position: absolute;
        top: 0;
        right: 0;
        z-index: 1;
      }
      &:nth-of-type(4) {
        position: absolute;
        top: calc(320px + 20px);
        left: 0;
        z-index: 1;
      }
      &:nth-of-type(5) {
        position: absolute;
        top: calc(320px + 20px);
        right: 0;
        z-index: 1;
      }
      &:nth-of-type(6) {
        position: absolute;
        bottom: 0;
        left: 0;
        z-index: 1;
      }
      &:nth-of-type(7) {
        position: absolute;
        bottom: 0;
        left: calc(600px + 20px);
        z-index: 1;
      }
      &:nth-of-type(8) {
        position: absolute;
        bottom: 0;
        right: 0;
        z-index: 1;
      }
    }
    .pandect {
      @include flex-dc-ic-jc;
      position: absolute;
      top: 0;
      left: calc(600px + 20px);
      width: 600px;
      height: 660px;
      background: transparent;

      .title {
        color: #55eda7;
        @include blod(38px);
      }
      .gear {
        @include flex-dc-ic-jc;
        position: relative;
        bottom: -60px;
        width: 426px;
        height: 426px;
        background: url("../../../../../../static/img/flh/news/home_yuan.png")
          left top no-repeat;
        background-size: 100% 100%;
        & > div > p {
          color: #55eda7;
          font-weight: bold;
          line-height: 1;
          text-align: center;
        }
        .gear_volume {
          margin-bottom: 30px;
          & > p {
            &:nth-of-type(1) {
              margin-bottom: 10px;
              font-size: 30px;
            }
            &:nth-of-type(2) {
              @include din(52px);
            }
          }
        }
        .gear_amount > p {
          &:nth-of-type(1) {
            margin-bottom: 10px;
            font-size: 24px;
          }
          &:nth-of-type(2) {
            @include din(36px);
          }
        }
        &:after {
          content: "";
          @include absoluteAllSides(30, 30, 30, 30, 1);
          width: 365px;
          height: 365px;
          background: url("../../../../../../static/img/flh/news/home_yuan2.png")
            left top no-repeat;
          background-size: 100% 100%;
          animation: rotate_jump 30s linear infinite;
        }
      }
    }
  }
}
@keyframes rotate_jump {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}
</style>
